package com.campus.app.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.campus.commons.entity.Notification;
import com.campus.app.mapper.NotificationMapper;
import com.campus.app.service.NotificationsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.campus.commons.utils.MyPage;
import com.campus.commons.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 消息【一些通知消息】表 服务实现类
 * </p>
 *
 * @author Rin
 * @since 2021-01-25
 */
@Service
public class NotificationServiceImpl extends ServiceImpl<NotificationMapper, Notification> implements NotificationsService {

    @Autowired
    private NotificationMapper notificationMapper;
    @Override
    public Result<List<Notification>> getAllNotifications(MyPage myPage) {
        return Result.result(notificationMapper.selectPage(new Page<>(myPage.getPage(),myPage.getLimit()),null));
    }
}
